<include file="Layout/header" />
<body>
<div class="breadcrumbs" id="breadcrumbs"> 
  <script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>
  <ul class="breadcrumb">
    <li> <i class="icon-home home-icon"></i> <a href="{:U('Admin/Index/welcome')}">首页</a> </li>
    <li class="active">代理报表</li>
  </ul>
</div>
<div class="page-content">
  <div class="page-header">
    <h1> 代理报表 <small> <i class="icon-double-angle-right"></i> 搜索 </small> </h1>
  </div>
  <div class="row">
    <form method="get" action="{:U('Admin/Member/dl_baobiao')}">
      <table class="table table-striped table-bordered table-hover table-condensed">
        <tr>
           <td width="15%"><input class="col-xs-12 col-sm-8" type="text" name="id" placeholder="会员ID" value="<?php echo $_GET['id']?>"></td>
         
          <td width="20%"><input class="btn btn-success" type="submit" value="搜索"></td>
        </tr>
      </table>
    </form>
    <div class="col-xs-12">
   
      <div class="table-responsive">
        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
          <thead>
            <tr>
             
              <th>ID</th>
              <th>会员名称</th>
              <th class="hidden-480">下注数</th>
              <th>下注金额</th>
              <th class="hidden-480">赢</th>
             
              <th>输</th>
              <th>退水</th>
              <th>盈亏结果</th>
            
            </tr>
          </thead>
          <tbody>
       
            <foreach name="list" item="val">
              <tr class="selected">
               
                <td>{$val.member_id}</td>
				 <td>
                {$val.member_name}
                </td>
                <td>{$val.cout}</td>
                <td >
                 {$val.money}
                </td>
                <td>{$val.win}</td>
                <td>{$val.lost}</td>
               
                <td>{$val.shui}</td>
               
                <td><?php echo sprintf('%.2f',$val['win']-$val['lost']+$val['shui'])?></td>
                
              </tr>
            </foreach>
       
            </tbody>
          
        </table>
       
      </div>
   
    </div>
   
  </div>
</div>
<include file="Layout/js"/> 
<link href="__ADMIN_CSS__/datepicker.css" rel="stylesheet" />
<script src="__ADMIN_JS__/date-time/bootstrap-datepicker.min.js"></script>
<script src="__ADMIN_JS__/jquery.ui.touch-punch.min.js"></script>
<script src="__ADMIN_JS__/jquery.dataTables.min.js"></script> 
<script src="__ADMIN_JS__/jquery.dataTables.bootstrap.js"></script> 
<script src="__ADMIN_JS__/bootbox.js"></script> 
<script type="text/javascript">
			jQuery(function($) {
				$("#datepicker").datepicker({
					showOtherMonths: true,
					selectOtherMonths: false,
					 
				});
				 
				$("#datepicker1").datepicker({
					showOtherMonths: true,
					selectOtherMonths: false,
					 
				}); 
				
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      null, null,null, null, null,
				  { "bSortable": false }
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
  				
			})
 		</script> 
<script type="text/javascript">       
/*资讯-下架*/
function member_stop(obj,id){
	var host=$("#member_show").val();
	bootbox.setLocale("zh_CN");  
      bootbox.confirm("确定禁用该会员?", function(result) {  
        if (result) {
		$.ajax({
			url:host,
			type:"POST",
			dataType:"json",
			data:{member_id:id},
			success: function(s){
				if(s.status == '1'){
			$(obj).parents("tr").find(".btn-group").prepend('<a class="btn btn-xs btn-success" onClick="member_stop(this,'+id+')" href="javascript:;" title="发布"><i class="icon-ok bigger-120"></i> </a>');
		    $(obj).parents("tr").find(".td-status").html('<span class="label label-sm label-inverse arrowed-in">禁用</span>');
		    $(obj).remove();
		    bootbox.alert('已禁用!');
			}else{
				 bootbox.alert(s.info);  
				  }
				}
			});
		
		
		}
	});
}

/*资讯-发布*/
function member_start(obj,id){
	 var host=$("#member_show").val();
	  bootbox.setLocale("zh_CN");  
      bootbox.confirm("确定开启该会员?", function(result) {  
        if (result) {  
		$.ajax({
			url:host,
			type:"POST",
			dataType:"json",
			data:{id:id},
			success: function(s){
			if(s.status == '1'){
			  $(obj).parents("tr").find(".btn-group").prepend('<a class="btn btn-xs btn-inverse" onClick="member_stop(this,'+id+')" href="javascript:;"> <i class=" icon-ban-circle bigger-120"></i>');
		      $(obj).parents("tr").find(".td-status").html('<span class="label label-sm label-success">开启</span>');
		      $(obj).remove();
		      bootbox.alert('已开启!');
				}else{
				 bootbox.alert(s.info);  
				  }
				}
		});
		
		
		}
	});
}
     /*文章-删除*/
function member_del(obj,id){
	var host=$("#member_del").val();
      bootbox.setLocale("zh_CN");  
      bootbox.confirm("确定删除该文章?", function(result) {  
        if (result) {  
           $.ajax({
			url:host,
			type:"POST",
			dataType:"json",
			data:{member_id:id},
			success: function(s){
 				if(s.status == '1'){
				$(obj).parents("tr").remove();
				bootbox.alert('删除成功');
				}else{
				bootbox.alert(s.info);	
					}
				}
			})
		
		 
        }  
      });  
 
}
/*批量-删除*/
function datadel(){
	 var is_check=$("input[type='checkbox']").is(':checked');
   if(is_check){
	    bootbox.setLocale("zh_CN");  
      bootbox.confirm("确定删除该会员?", function(result) {  
        if (result) {  
           $("#ondel").submit();
         }  
      });  
    }else{
      bootbox.alert({  
            buttons: {  
               ok: {  
                    label: '返回',  
                    className: 'btn-myStyle'  
                }  
            },  
            message: '请选择要删除的会员',  
            callback: function() {  
               // alert('关闭了alert');  
            },  
            title: "提示信息",  
        });


    }
	 
	
}
 </script>
</body>
</html>